package com.xnyzc.lhy.mis.controller.cmsapi.account;


import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.param.account.AccountParam;
import com.xnyzc.lhy.mis.entity.param.account.OaDAccountAdjustmentDetailParam;
import com.xnyzc.lhy.mis.entity.param.account.AccountAdjustmentParam;
import com.xnyzc.lhy.mis.service.account.IOaDAccountAdjustmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 司机账户调整表 前端控制器
 * </p>
 *
 * @author cuichaoqun
 * @since 2019-10-19
 */
@RestController
@Api(value = "司机账户调整", tags = {"司机账户调整接口"})
@RequestMapping("/cmsapi/account")
public class OaDAccountAdjustmentController {
    @Autowired
    private IOaDAccountAdjustmentService iOaDAccountAdjustmentService;

    /**
     * 查询司机账户调整状态
     *
     * @return
     */
    @ApiOperation(value = "查询司机账户调整状态", notes = "查询司机账户调整状态")
    @GetMapping(value = "/queryAdjustmentStatue")
    public Rv queryAdjustmentStatue() {
        return iOaDAccountAdjustmentService.queryAdjustmentStatue();
    }

    /**
     * 账户上传司机账户调整信息 oa_d_account_adjustment
     *
     * @return
     */
    @ApiOperation(value = "司机账户上传信息", notes = "司机账户上传信息")
    @PostMapping(value = "/accountAdjustmentImport")
    public Rv accountAdjustmentImport(@RequestBody OaDAccountAdjustmentDetailParam oaDAccountAdjustmentDetailParam) {

        return iOaDAccountAdjustmentService.insertIOaDAccountAdjustment(oaDAccountAdjustmentDetailParam);
    }


    /**
     * 修改审核状态 调整状态(0审核中、1审核通过、2审核失败)
     */
    @ApiOperation(value = "修改审核状态", notes = "修改审核状态")
    @PostMapping(value = "/upDateIOaDAccountAdjustmentStatue")
    public Rv upDateIOaDAccountAdjustmentStatue(@ApiParam(name = "agreementParam", value = "接入传参") @RequestBody AccountParam accountParam) {
        return iOaDAccountAdjustmentService.updateIOaDAccountAdjustmentStatue(accountParam.getAdjustmentState(), accountParam.getAdjustmentId());
    }

    /**
     * 删除司机账户调整
     *
     * @ApiParam(name="adjustmentId",value="司机账户调整adjustmentId")
     */
    @ApiOperation(value = "司机账户删除", notes = "司机账户删除")
    @PostMapping(value = "/deleteDateIOaDAccountAdjustment")
    public Rv deleteDateIOaDAccountAdjustment(@ApiParam(name = "agreementParam", value = "接入传参") @RequestBody AccountParam accountParam) {
        return iOaDAccountAdjustmentService.deleteDateIOaDAccountAdjustment(accountParam.getAdjustmentId());
    }


    /**
     * 司机账户调整表查询
     */
    @ApiOperation(value = "司机账户调整表查询", notes = "司机账户调整表查询")
    @PostMapping(value = "/selectDateIOaDAccountAdjustment")
    public Rv queryDateIOaDAccountAdjustment(@ApiParam(name = "accountAdjustmentParam", value = "查询条件") @RequestBody AccountAdjustmentParam accountAdjustmentParam) {

        return iOaDAccountAdjustmentService.queryDateIOaDAccountAdjustment(accountAdjustmentParam);
    }

    @ApiOperation(value = "下载账户调整模板", notes = "下载账户调整模板")
    @GetMapping(value = "/getAccountAdjustmentDownloadTemplate")
    public Rv getAccountAdjustmentDownloadTemplate() {
        return iOaDAccountAdjustmentService.getAccountAdjustmentDownloadTemplate();
    }


}
